package com.example.robertluozizhao.framecollectdemo.db.manager

import android.content.Context
import androidx.room.Room


class DbManager {

    private val mBuilder: DataBaseTest? = null


    companion object{
        val instance:DbManager by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED){
            DbManager()
        }
    }


    @Synchronized fun getBuilder(context: Context): DataBaseTest {
        return mBuilder?: Room.databaseBuilder(
                context,
                DataBaseTest::class.java, "frame.db"
        ).build()
    }


}